import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2025-01-12
 * Time: 21:42
 */
public class Main {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        list.add("ddd");

        Iterator<String> iterator = list.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
        Integer value = 2;
        list.remove(value);
        System.out.println(list);

        List<String> list1 = new ArrayList<>();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        list.add("ddd");
        System.out.println(list1.contains("aaa"));

        List<String> list2 = new ArrayList<>();
        list2.add("aaa");
        list2.add("bbb");
        list2.add("ccc");
        list2.add("ddd");
        List<String> sublist = list2.subList(1,3);
        System.out.println(sublist);

        List<String> list3 = new ArrayList<>();
        list3.add("aaa");
        list3.add("aaa");
        list3.add("aaa");
        list3.add("aaa");
        System.out.println(list3);
        list3.clear();
        System.out.println(list3);
    }
}
